package interfaces;


import java.rmi.Remote;
import java.rmi.RemoteException;

/**
 * Methoddeclaration of chatserver.
 * Declares methods for clients to subscribe or unsubscribe at server.
 *
 * @author Dominik Korittki
 * @author Steffen Grushka
 * @version 0.1
 */
public interface ChatServer extends Remote {
	
	/**
	 * Generates a chatproxy object and saves it in clientlist
	 * @params username Username of client
	 * @params handle clientproxy object of client
	 * @return null if username already given or chatproxy object if everything went well
	 */
	public ChatProxy subscribeUser(String username, ClientProxy handle) throws RemoteException;
	
	/**
	 * Disconnects user from chat and deletes it from list
	 * @param username of user to disconnect
	 * @return true if successfully disconnected or false if not
	 * @throws RemoteException
	 */
	public boolean unsubscribeUser(String username) throws RemoteException;
}
